<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="stylesheet" type="text/css" href="<c:url value="/css/themes/default/easyui.css"/>">
<link rel="stylesheet" type="text/css" href="<c:url value="/css/themes/icon.css"/>">
<link rel="stylesheet" type="text/css" href="<c:url value="/css/themes/yzr_style.css"/>">

<script type="text/javascript" src="<c:url value="/js/jquery.min.js"/>"></script>
<script type="text/javascript" src="<c:url value="/js/jquery.easyui.min.js"/>"></script>
<script type="text/javascript" src="<c:url value="/js/easyui-lang-zh_CN.js"/>"></script>
<title>药库库存</title>
</head>
<body>
<script type="text/javascript">

	var yzr_medStore = [[
         		{field:'medStockId',width:'15%',title:'库存编号',align:'center'},
         		{field:'storeName', width:'20%',title:'仓库',align:'center'},
         		{field:'medStockMedName',width:'17%',title:'药品名',align:'center'},
            	{field:'medStockMedKind', width:'10%',title:'类型',align:'center'},
         		{field:'medStockBatchnumber',width:'12%',title:'批号',align:'center'},
        		{field:'medStockGuige', width:'8%',title:'规格',align:'center'},
        		{field:'medStockUnit', width:'8%',title:'单位',align:'center'},
        		/* {field:'medStockPrice', width:'10%',title:'单价',align:'center'}, */
        		{field:'medStockNumber', width:'10%',title:'数量',align:'center',
        			styler:function(value,row,index){ 
					if(row.medStockNumber < 20){
						return 'color:red;';
					}}}
        		/* {field:'medStockMoney', width:'10%',title:'金额',align:'center'} */
             ]];	
</script>
<script type="text/javascript">	
	$(function(){
		//显示全部
		$("#yzr-medStore-reload").linkbutton({onClick:function(){
			$("#tb-medStore").datagrid({
	    		url: 'queryMedStoreGroup_yzr', 
	    		method: 'get'
	    	});			
		}});
			
			
		//搜索
		$('#yzr-medStore-search').searchbox({
		    searcher:function(value,name){
		    	if(value == ''){
		    		$.messager.alert("提示", "请输入查询条件！");
		    	}else{
		    		$("#tb-medStore").datagrid({	    		
			    		url: 'queryMedByName_yzr',
			    		method: 'post', 
			    		queryParams: {
			    			page:1,
			    			rows:13,
			    			medName: value
			    	}});
		    		$('#yzr-medStore-search').searchbox('setValue', '');
		    	}
		    	
		    }
		}); 
		
		
		
		//调整
		$("#yzr-medStore-qiehuan").linkbutton({
			onClick:function(){
				$("#tb-medStore").propertygrid({
					groupField:'storeName'
				});
			}
		});			
	});
</script>



	<table id="tb-medStore" class="easyui-propertygrid"
		data-options="
					fitColumns: true,
					fit: true,
					showGroup: true,
					pagination: true,
					url: 'queryMedStoreGroup_yzr',
					singleSelect: false,
					border: false,
					pageSize: 13,
					pageList: [13,26,39,52],
					columns: yzr_medStore,
					groupField: 'medStockMedKind',
					toolbar: '#yzr-medStore-tb'
					
				">
	</table>

	<div id="yzr-medStore-tb">		
		<input id="yzr-medStore-search" class="easyui-searchbox" data-options="menu: '#yzr-medStore-pName', width: 220, prompt: '请输入关键字'"/>
		<a id="yzr-medStore-reload" class="easyui-linkbutton" data-options="iconCls:'icon-reload',plain:true">刷新</a>
		<a id="yzr-medStore-qiehuan" class="easyui-linkbutton" data-options="iconCls:'icon-tiaozheng',plain:true">切换分组</a>
	</div>
	
	<div id="yzr-medStore-pName" style="width:140px">
	    <div data-options="name:'name'">药品名称</div>
	    <!-- <div data-options="name:'kind'">药品类型</div> -->
	</div>








	<!-- <table id="tb-medStore" class="easyui-datagrid"           rowStyler: cc_rowStlye
		data-options="
			url:'queryMedStoreGroup_yzr',
			groupField:'medStockMedKind',
			
			remoteSort:false,
			nowrap:false,
			fitColumns:true,
			fit:true,
			pagination: true,
			pageSize: 10,
			pageList: [10, 20, 30, 40],
			rownumbers: true,
			border:false
			">
		<thead>
			<tr>	
			库存编号，仓库编号，药品编号，药品名，批号，类型（中药，西药），规格，单位，单价，数量，金额	
			//medStockId,medStockBatchnumber,medStockGuige,medStockMedId,medStockMedKind,medStockMedName,medStockMoney,
			//medStockNumber,medStockPrice,medStockStoreId,medStockUnit
				<th data-options="field:'medStockId',width:'12%'">库存编号</th>
				<th data-options="field:'medStockStoreId',width:'12%'">仓库编号</th>
				<th data-options="field:'medStockMedName',width:'15%'">药品名</th>
				<th data-options="field:'medStockMedKind',width:'10%'">类型</th>	
				<th data-options="field:'medStockBatchnumber',width:'10%'">批号</th>					
				<th data-options="field:'medStockGuige',width:'8%'">规格</th>	
				<th data-options="field:'medStockUnit',width:'5%'">单位</th>	
				<th data-options="field:'medStockPrice',width:'8%'">单价</th>	
				<th data-options="field:'medStockNumber',width:'8%'">数量</th>	
				<th data-options="field:'medStockMoney',width:'10%'">金额</th>								
			</tr>
		</thead>
	</table> -->
	
	
</body>
</html>